package com.java.intercept;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class ActionIntercept extends AbstractInterceptor {
	public String intercept(ActionInvocation ai) throws Exception {
		//Object o=ai.getInvocationContext().getSession().get("user");
		Object o=ActionContext.getContext().getSession().get("user");
		System.out.println(o + " intercept.....");
		if(o!=null){
			return ai.invoke();
		}else{
			return "nosession";
		}
	}
}
